package com.web.servlet;

import com.web.entity.Student;
import com.web.service.StudentService;
import com.web.serviceimpl.StudentServiceImpl;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 学生个人修改学生基本信息
 *
 * @author 17612
 */
@WebServlet("/msstu")
public class ModifyStudentServlet extends HttpServlet {
    StudentService studentService = new StudentServiceImpl();

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        String sid = req.getParameter("Sid");
        String sname = req.getParameter("Sname");
        String sgender = req.getParameter("Sgender");
        String classid = req.getParameter("ClassID");
        
        Student student = new Student(sid,sname,sgender,classid);
        
        int rows = studentService.modifyStudentInfo(student);
        
        resp.getWriter().print(rows);
    }
    
    

}
